#include "Game.h"

bool Game::Initialize()
{
	gameDeck = new Deck;
	gameDeck->FillDeck();
	gameDeck->ShuffleDeck();

	context = new Context(this);

	for(int x = 0; x < PlayerCount; ++x)
	{
		Player* player;

		switch(x)
		{
		case 0:
			player = new Player("Player1", true);
			DealCard(player, 2);
			break;
		case 1:
			player = new Player("Player2", true);
			DealCard(player, 2);
			break;
		case 2:
			player = new Player("Dealer", false);
			DealCard(player, 2);
			break;
		}

		playerList.push_back(player);
	}

	currentPlayer = playerList[0];
	currentRound = 0;
	Running = true;
	Endgame = false;

	if(gameDeck == NULL || context == NULL || currentPlayer == NULL || playerList.size() < PlayerCount)
	{
		return false;
	}

	return true;
}